package com.colis.quartz.common.task;

import com.alibaba.fastjson.JSON;
import com.colis.quartz.module.sms.QuartzTask;
import com.colis.quartz.provider.sms.mapper.QuartzTaskMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Optional;

/**
 * <p> 描述： </p>
 *
 * @author wlp
 * @version 1.0.0
 * @date 2022/1/14 15:35
 */
@Slf4j
@Component
public class MyTask {

    @Autowired
    private QuartzTaskMapper quartzTaskMapper;

    public void runTask(String str) {
        Optional<QuartzTask> quartzTask = quartzTaskMapper.findById(1L);
        log.info("参数值：" + str);
        log.info("查询数据：" + JSON.toJSONString(quartzTask.orElse(new QuartzTask())));
    }


}
